The present invention relates to the field of data processing, and, more particularly, to a method and apparatus for converting coordinates from a source coordinate system to a target coordinate system.
Many scientific and engineering software applications require the conversion or transformation of coordinates from a source coordinate system to a target coordinate system. For example, different coordinate systems may be used for launching and tracking a satellite wherein each coordinate system supports a particular objective.
For instance, range personnel responsible for tracking the position of the satellite in orbit use a first coordinate system based upon a center of the earth coordinate system. A second coordinate system may be used by personnel responsible for a lower booster stage to launch the satellite from the launch pad. Likewise, a third coordinate system may be used by personnel responsible for an upper booster stage. The second and third coordinate systems are based upon coordinate systems with respect to the booster stages and the launch pad.
Converting coordinates between the different coordinate systems is necessary, which consequently, requires a coordinate conversion from the source coordinate system to the target coordinate system. Since there is no single coordinate system that is sufficient for describing the problem space of all the possible coordinate systems, software programmers define a coordinate system that is meaningful to their particular objective for launching and tracking the satellite.
Invariably, ambiguities arise when coordinate data is passed to another coordinate system and the source coordinate system is not known. These ambiguities can be documented, but this is an ineffective way to prevent common errors that may occur when coordinate data is used out of context. For example, coordinate data passed as meters may be interpreted as feet.
These types of problems are difficult to debug since the defect presents itself, not where the coordinate data was misinterpreted, but later in the process when the mistake eventually produces an errant result. Software programmers are forced to debug the problem from the symptom, i.e., the errant result, rather than the cause, i.e., misinterpretation of meters as feet.
Due to the unlimited number of coordinate systems that may be defined, it is difficult to provide a total solution space. In other words, it is difficult to provide a single coordinate system to be used by all the software programmers for launching and tracking the satellite. One approach is to have a centralized coordinate system. When the above described three coordinate systems are configured in a centralized coordinate system, there are nine possible coordinate conversions or transformations that can be performed. The nine possible coordinate conversions among the three different coordinate systems may be represented as AA, AB, AC, BA, BB, BC, CA, CB and CC. A disadvantage of this approach requires the software programmer to know the source and target coordinate system and the transformation to apply for each possible coordinate conversion.
Another disadvantage of the centralized coordinate system is its lack of adaptability to support coordinate conversion from the source coordinate system to a new coordinate system. To support a fourth coordinate system, for example, sixteen different coordinate conversions are required to be supported. Accordingly, seven new coordinate conversions must be defined by the software programmers, which can be represented by AD, BD, CD, DA, DB, DC and DD. Adding these additional coordinate conversions requires modifying existing software, which is undesirable since a new programming error could be introduced into software that has already been coded and verified. Consequently, there is a need for reliably converting coordinates between a source coordinate system and a target coordinate system, particularly when converting coordinates between the source coordinate system and a new coordinate system.
In view of the foregoing background, it is therefore an object of the present invention to provide a coordinate system framework that permits efficient conversions and is readily extensible for adding additional coordinate systems.
These and other objects, features and advantages in accordance with the present invention are provided by a method for converting between source coordinates in a source coordinate system and target coordinates in a target coordinate system comprising the step of defining a coordinate system conversion tree extending from a root coordinate system and branching to a plurality of other coordinate systems including the source and target coordinate systems so that the source and target coordinate systems are connected to a common coordinate system other than the root coordinate system. Coordinate conversions are preferably performed between the source and target coordinates along branches extending from the source coordinate system to the common coordinate system, and to the target coordinate system without returning to the root coordinate system. In other words, the source and target coordinate systems are thus related through a coordinate system conversion tree which does not require conversion back to the root coordinate system.
The method preferably further comprises associating contextual data with respective coordinates of each coordinate system for performing coordinate conversions with at least one adjacent coordinate system.
One advantageous feature of using a coordinate system conversion tree is that the contextual data associated with each coordinate system allows conversion to an adjacent coordinate system without the source coordinate system having knowledge of how to convert the coordinates to the target coordinate system. The step of performing coordinate conversions preferably comprises sequentially performing coordinate conversions up the coordinate system conversion tree from the source coordinate system to at least one adjacent coordinate system until a conversion is made with the common coordinate system. Likewise, the step of performing coordinate conversions preferably comprises sequentially performing coordinate conversions down the coordinate system conversion tree from the common coordinate system to at least one adjacent coordinate system until a conversion is made with the target coordinate system.
A centralized coordinate system is advantageously avoided since coordinates can be converted to an adjacent coordinate system based upon the associated contextual data of the respective coordinate system. Since coordinate conversions are performed with respect to a common coordinate system, a distributed framework of coordinate systems is provided for reliably converting coordinates between source and target coordinate systems.
The method preferably further comprises the steps of adding an additional coordinate system to the coordinate system conversion tree, and verifying whether the additional coordinate system is connected to at least one other coordinate system via a common coordinate system. Coordinate conversions between the source coordinate system and the new coordinate system are performed if the verifying is successful. If the step of verifying is unsuccessful, then a warning is preferably provided.
In addition, the method according to the present invention is scalable. The amount of modules to code for adding a new coordinate system remains constant while the amount of functionality added to the system, i.e., number of possible conversions, grows linearly. The distributed framework of coordinate systems can be extended to support any user-defined coordinate system without modifying previously defined coordinate systems. The framework is both open to extension and closed to modification of pre-existing, working tested code. Since no modifications are required to the basic framework, the method can be provided as a set of commercial off-the-shelf (COTS) header files and shared libraries that are extended through derivation to meet the needs of a particular user. The user""s new coordinate system simply plugs into the set of pre-defined coordinate systems, and are able to participate in conversions to any related coordinate system thereafter via the coordinate system conversion tree.
The coordinate systems may comprise an atomic coordinate system, a geospatial coordinate system, or an n-dimensional coordinate system.
Another aspect of the present invention is to convert between source coordinates in a source coordinate system and target coordinates in a target coordinate system by defining at least a portion of a coordinate system conversion tree extending from a common coordinate system and branching to the source and target coordinate systems with at least one intervening intermediate conversion system therebetween. Coordinate conversions are preferably performed between the source and target coordinates along branches extending from the source coordinate system to the common coordinate system and to the target coordinate system. The coordinates preferably have contextual data associated therewith for each respective coordinate system for performing coordinate conversions with at least one adjacent coordinate system.
A further aspect of the present invention is to provide a machine readable medium having machine readable instructions thereon for causing a computer to convert between source coordinates in a source coordinate system and target coordinates in a target coordinate system as discussed above.
Yet another aspect of the present invention is to provide an apparatus comprising a processor for converting image data at source coordinates in a source coordinate system to target coordinates in a target coordinate system. The processor preferably performs the step of defining at least a portion of a coordinate system conversion tree extending from a common coordinate system to the source and target coordinate systems with at least one intervening intermediate conversion system therebetween. Coordinate conversions of the image data are preferably performed between the source and target coordinates along branches extending from the source coordinate system to the common coordinate system and to the target coordinate system. The apparatus also includes a display for displaying the converted image data.
The coordinates preferably have contextual data associated therewith for each respective coordinate system for performing coordinate conversions with at least one adjacent coordinate system.